/**
* Author: Samfu
* Time  : 上午2:57:13
* Desc  : 
*/
package com.fu.moneybag.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.fu.moneybag.entity.ArticleType;
import com.fu.moneybag.entity.User;
import com.fu.moneybag.service.ArticleTypeService;
import com.fu.moneybag.validation.UserSessionExpiredChecking;

@Controller
@RequestMapping("/articleType")
public class ArticleTypeController {

	private Logger logger = Logger.getLogger(ArticleTypeController.class);
	
	@Autowired 
	private ArticleTypeService articleTypeService;

	
	@RequestMapping("articleTypeManagement")
	public String manage(HttpServletRequest request, HttpSession session){
		
		return articleTypeService.getAllArticleTypes(request, session);
	}
	
	//添加博客类型
	@RequestMapping("/addArticleType")
	public String createNewArticleType(HttpServletRequest request, HttpSession session,
			String articleType, HttpServletResponse response) {
		
		return articleTypeService.createNewArticleType(request, session, articleType);
	}
	
	//删除博客类型
	@RequestMapping("/deleteArticleType")
	public String deleteArticleType(HttpServletRequest request, HttpSession session, String[] types) {
		return articleTypeService.deleteArticleTypes(request, session, types);
	}
}
